//
//  ButtonCollectionViewCell.m
//  礼物说
//
//  Created by dllo on 16/4/23.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "ButtonCollectionViewCell.h"

@interface ButtonCollectionViewCell ()

@property (nonatomic, retain) BaseLabel *lable;

@end

@implementation ButtonCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}
- (void)dealloc{
    [_title release];
    [_lable release];
    [super dealloc];
}

- (void)setTitle:(NSString *)title{
    if ( _title != title) {
        [_title release];
        _title = [title retain];
    }
    
    self.lable.text = _title;
}
- (void)createCell{
    
    self.lable = [[BaseLabel alloc] init];
    [self.contentView addSubview:_lable];
    [_lable release];
    
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    [super layoutSubviews];
    
    _lable.frame = self.contentView.frame;
    _lable.textAlignment = NSTextAlignmentCenter;
    
}


@end
